﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MaterialWinforms;

namespace BullshitArticalGenerator.Items
{
    public partial class RoundPanel : Panel
    {
        private int _cornerRadius = 20;
        public int CornerRadius
        {
            get
            {
                return _cornerRadius;
            }
            set
            {
                if (value < 0 || value > 180)
                {
                    return;
                }
                _cornerRadius = value;
                Invalidate();
            }
        }

        public int Depth;

        public RoundPanel()
        {
            InitializeComponent();

            this.BackColor = Color.White;
        }

        protected override void OnPaint(PaintEventArgs e)
        {
            base.OnPaint(e);
            this.Region = new Region(DrawHelper.GetRoundedRectPath(new Rectangle(0, 0, Width, Height), _cornerRadius));
        }
    }
}
